package net.wofly.sale.shoppingcart.service;

import net.wofly.framework.util.ReturnBean;
import net.wofly.sale.order.domain.Order;
import net.wofly.sale.shoppingcart.entity.CartList;

import java.util.List;

/**
 * @author lign
 * @version 1.0
 * @created 29-十月-2017 11:13:50
 */
public interface IShoppingCartService {

	/**
	 * 添加商品到购物车
	 * <ul>
	 * 	<li>判断购物车里是否有此商品，如果有，则修改购物车此商品数量；如果没有新增此商品及数量</li>
	 * 	<li></li>
	 * </ul>
	 * 
	 * @param userID
	 * @param commodityID
	 * @param num
	 */
	ReturnBean<String> addCommodityToCart(String userID, Integer shoppingCartType, String commodityID, Integer num);

	/**
	 * 修改商品数量，进入购物车后的操作
	 * <ul>
	 * 	<li>在购物车里修改购物车商品的数量 </li>
	 * 	<li></li>
	 * </ul>
	 * 
	 * @param cartListID
	 * @param num
	 */
	ReturnBean<String> changeCommodityNum(String cartListID, Integer num);

	/**
	 * 商品从购物车里删除
	 * <ul>
	 * 	<li></li>
	 * </ul>
	 * 
	 * @param cartListID
	 */
	ReturnBean<String> delCommodity(String cartListID);

	/**
	 *
	 * @param userID
	 */
	ReturnBean<List<CartList>> getCartList(String userID, Integer shoppingCartType);

	ReturnBean<Order> commitCart(String userID, List<CartList> carts) throws CloneNotSupportedException;
}